# encoding:utf-8
# 用于初始化虚拟环境，安装项目所需的包，在虚拟目录终端下(venv) D:\PycharmProjects\ProcessCenter_Api_Autotest，执行python init_venv.py
import os

# 设置pip国内源及信任host
os.system(
    r"pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/&"
    r"pip config set install.trusted-host mirrors.aliyun.com")
# 获取当前目录
cur = os.getcwd()
print(f"current directory: {cur}")
# 切换到当前目录，并降级setuptools(不降级无法安装某些库)，再安装requirements.txt
os.system(rf"cd {cur}&pip install setuptools==41.2.0&pip install -r ./requirements.txt")
